// Copyright 2022 The Dawn & Tint Authors
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this
//    list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice,
//    this list of conditions and the following disclaimer in the documentation
//    and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its
//    contributors may be used to endorse or promote products derived from
//    this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

////////////////////////////////////////////////////////////////////////////////
// File generated by 'tools/src/cmd/gen' using the template:
//   src/tint/lang/core/builtin_type_test.cc.tmpl
//
// To regenerate run: './tools/run gen'
//
//                       Do not modify this file directly
////////////////////////////////////////////////////////////////////////////////

#include "src/tint/lang/core/builtin_type.h"

#include <string>

#include "gtest/gtest.h"

#include "src/tint/utils/text/string.h"

namespace tint::core {
namespace {

namespace parse_print_tests {

struct Case {
    const char* string;
    BuiltinType value;
};

inline std::ostream& operator<<(std::ostream& out, Case c) {
    return out << "'" << std::string(c.string) << "'";
}

static constexpr Case kValidCases[] = {
    {"__atomic_compare_exchange_result_i32", BuiltinType::kAtomicCompareExchangeResultI32},
    {"__atomic_compare_exchange_result_u32", BuiltinType::kAtomicCompareExchangeResultU32},
    {"__frexp_result_abstract", BuiltinType::kFrexpResultAbstract},
    {"__frexp_result_f16", BuiltinType::kFrexpResultF16},
    {"__frexp_result_f32", BuiltinType::kFrexpResultF32},
    {"__frexp_result_vec2_abstract", BuiltinType::kFrexpResultVec2Abstract},
    {"__frexp_result_vec2_f16", BuiltinType::kFrexpResultVec2F16},
    {"__frexp_result_vec2_f32", BuiltinType::kFrexpResultVec2F32},
    {"__frexp_result_vec3_abstract", BuiltinType::kFrexpResultVec3Abstract},
    {"__frexp_result_vec3_f16", BuiltinType::kFrexpResultVec3F16},
    {"__frexp_result_vec3_f32", BuiltinType::kFrexpResultVec3F32},
    {"__frexp_result_vec4_abstract", BuiltinType::kFrexpResultVec4Abstract},
    {"__frexp_result_vec4_f16", BuiltinType::kFrexpResultVec4F16},
    {"__frexp_result_vec4_f32", BuiltinType::kFrexpResultVec4F32},
    {"__modf_result_abstract", BuiltinType::kModfResultAbstract},
    {"__modf_result_f16", BuiltinType::kModfResultF16},
    {"__modf_result_f32", BuiltinType::kModfResultF32},
    {"__modf_result_vec2_abstract", BuiltinType::kModfResultVec2Abstract},
    {"__modf_result_vec2_f16", BuiltinType::kModfResultVec2F16},
    {"__modf_result_vec2_f32", BuiltinType::kModfResultVec2F32},
    {"__modf_result_vec3_abstract", BuiltinType::kModfResultVec3Abstract},
    {"__modf_result_vec3_f16", BuiltinType::kModfResultVec3F16},
    {"__modf_result_vec3_f32", BuiltinType::kModfResultVec3F32},
    {"__modf_result_vec4_abstract", BuiltinType::kModfResultVec4Abstract},
    {"__modf_result_vec4_f16", BuiltinType::kModfResultVec4F16},
    {"__modf_result_vec4_f32", BuiltinType::kModfResultVec4F32},
    {"__packed_vec3", BuiltinType::kPackedVec3},
    {"array", BuiltinType::kArray},
    {"atomic", BuiltinType::kAtomic},
    {"bool", BuiltinType::kBool},
    {"f16", BuiltinType::kF16},
    {"f32", BuiltinType::kF32},
    {"i32", BuiltinType::kI32},
    {"input_attachment", BuiltinType::kInputAttachment},
    {"mat2x2", BuiltinType::kMat2X2},
    {"mat2x2f", BuiltinType::kMat2X2F},
    {"mat2x2h", BuiltinType::kMat2X2H},
    {"mat2x3", BuiltinType::kMat2X3},
    {"mat2x3f", BuiltinType::kMat2X3F},
    {"mat2x3h", BuiltinType::kMat2X3H},
    {"mat2x4", BuiltinType::kMat2X4},
    {"mat2x4f", BuiltinType::kMat2X4F},
    {"mat2x4h", BuiltinType::kMat2X4H},
    {"mat3x2", BuiltinType::kMat3X2},
    {"mat3x2f", BuiltinType::kMat3X2F},
    {"mat3x2h", BuiltinType::kMat3X2H},
    {"mat3x3", BuiltinType::kMat3X3},
    {"mat3x3f", BuiltinType::kMat3X3F},
    {"mat3x3h", BuiltinType::kMat3X3H},
    {"mat3x4", BuiltinType::kMat3X4},
    {"mat3x4f", BuiltinType::kMat3X4F},
    {"mat3x4h", BuiltinType::kMat3X4H},
    {"mat4x2", BuiltinType::kMat4X2},
    {"mat4x2f", BuiltinType::kMat4X2F},
    {"mat4x2h", BuiltinType::kMat4X2H},
    {"mat4x3", BuiltinType::kMat4X3},
    {"mat4x3f", BuiltinType::kMat4X3F},
    {"mat4x3h", BuiltinType::kMat4X3H},
    {"mat4x4", BuiltinType::kMat4X4},
    {"mat4x4f", BuiltinType::kMat4X4F},
    {"mat4x4h", BuiltinType::kMat4X4H},
    {"ptr", BuiltinType::kPtr},
    {"sampler", BuiltinType::kSampler},
    {"sampler_comparison", BuiltinType::kSamplerComparison},
    {"texture_1d", BuiltinType::kTexture1D},
    {"texture_2d", BuiltinType::kTexture2D},
    {"texture_2d_array", BuiltinType::kTexture2DArray},
    {"texture_3d", BuiltinType::kTexture3D},
    {"texture_cube", BuiltinType::kTextureCube},
    {"texture_cube_array", BuiltinType::kTextureCubeArray},
    {"texture_depth_2d", BuiltinType::kTextureDepth2D},
    {"texture_depth_2d_array", BuiltinType::kTextureDepth2DArray},
    {"texture_depth_cube", BuiltinType::kTextureDepthCube},
    {"texture_depth_cube_array", BuiltinType::kTextureDepthCubeArray},
    {"texture_depth_multisampled_2d", BuiltinType::kTextureDepthMultisampled2D},
    {"texture_external", BuiltinType::kTextureExternal},
    {"texture_multisampled_2d", BuiltinType::kTextureMultisampled2D},
    {"texture_storage_1d", BuiltinType::kTextureStorage1D},
    {"texture_storage_2d", BuiltinType::kTextureStorage2D},
    {"texture_storage_2d_array", BuiltinType::kTextureStorage2DArray},
    {"texture_storage_3d", BuiltinType::kTextureStorage3D},
    {"u32", BuiltinType::kU32},
    {"vec2", BuiltinType::kVec2},
    {"vec2f", BuiltinType::kVec2F},
    {"vec2h", BuiltinType::kVec2H},
    {"vec2i", BuiltinType::kVec2I},
    {"vec2u", BuiltinType::kVec2U},
    {"vec3", BuiltinType::kVec3},
    {"vec3f", BuiltinType::kVec3F},
    {"vec3h", BuiltinType::kVec3H},
    {"vec3i", BuiltinType::kVec3I},
    {"vec3u", BuiltinType::kVec3U},
    {"vec4", BuiltinType::kVec4},
    {"vec4f", BuiltinType::kVec4F},
    {"vec4h", BuiltinType::kVec4H},
    {"vec4i", BuiltinType::kVec4I},
    {"vec4u", BuiltinType::kVec4U},
};

static constexpr Case kInvalidCases[] = {
    {"__atomic_compareexchangeccresult_i32", BuiltinType::kUndefined},
    {"__atoml3_compare_exchane_resulti2", BuiltinType::kUndefined},
    {"__atomic_compare_Vxchange_result_i32", BuiltinType::kUndefined},
    {"__atomic_com1are_exchange_result_u32", BuiltinType::kUndefined},
    {"__atomic_qqompare_exchage_resulJ_u32", BuiltinType::kUndefined},
    {"__atllmic_compare_exchange_result_u377", BuiltinType::kUndefined},
    {"qpp_frexp_resultHHbstract", BuiltinType::kUndefined},
    {"__fep_esulv_abstract", BuiltinType::kUndefined},
    {"__Gbexp_resul_abstract", BuiltinType::kUndefined},
    {"_vfrexp_resiilt_f16", BuiltinType::kUndefined},
    {"__fr8xp_resultWWf16", BuiltinType::kUndefined},
    {"__frxp_result_fMxx", BuiltinType::kUndefined},
    {"gg_fXexp_reslt_f32", BuiltinType::kUndefined},
    {"__frXxpresul_V32", BuiltinType::kUndefined},
    {"__frexp_r3sult_f32", BuiltinType::kUndefined},
    {"__frexpEresult_vec2_abstract", BuiltinType::kUndefined},
    {"__frex_rPPsult_vTTc2_abstract", BuiltinType::kUndefined},
    {"__frexp_resuddt_ec2_xxbstract", BuiltinType::kUndefined},
    {"__frexp_result_ve442_f16", BuiltinType::kUndefined},
    {"_SSfrexp_resulVV_vec2_f16", BuiltinType::kUndefined},
    {"__fRxpRr22sult_vec2_f16", BuiltinType::kUndefined},
    {"__frexp_res9lt_vec_fF2", BuiltinType::kUndefined},
    {"__frexp_result_ve2_f32", BuiltinType::kUndefined},
    {"_OOfrexp_result_VeHRRf32", BuiltinType::kUndefined},
    {"__frexp_reyult_vec3_absract", BuiltinType::kUndefined},
    {"__frexp_re77ulll_vecG_arrnstract", BuiltinType::kUndefined},
    {"__4rexp_result_vec3_00bstract", BuiltinType::kUndefined},
    {"__oorxp_result_vec316", BuiltinType::kUndefined},
    {"zz_frexp_esult_ec3_f16", BuiltinType::kUndefined},
    {"__iirex11_result_vp3_f16", BuiltinType::kUndefined},
    {"__frXXxp_result_vec3_f32", BuiltinType::kUndefined},
    {"__fnnexp99resIIlt_vec3_f355", BuiltinType::kUndefined},
    {"__faSSerrp_result_vHHc3_fY2", BuiltinType::kUndefined},
    {"__freHp_resutve4_abstkkact", BuiltinType::kUndefined},
    {"jfrexpgresult_veRR4_abstrac", BuiltinType::kUndefined},
    {"__frexp_resul_vec4_absbrac", BuiltinType::kUndefined},
    {"_jfrexp_result_vec4_f16", BuiltinType::kUndefined},
    {"__frexp_resultvec4_f16", BuiltinType::kUndefined},
    {"__freqpresultvec4_f16", BuiltinType::kUndefined},
    {"__frexNN_result_vec_f32", BuiltinType::kUndefined},
    {"__frexp_resvvlt_vc4_f3", BuiltinType::kUndefined},
    {"__frexp_esult_vec4_f3QQ", BuiltinType::kUndefined},
    {"rmodf_reffultabstract", BuiltinType::kUndefined},
    {"__jodf_result_abstract", BuiltinType::kUndefined},
    {"_mNNwdf_r2sult8abstract", BuiltinType::kUndefined},
    {"__mdf_result_f16", BuiltinType::kUndefined},
    {"__modrr_result_f16", BuiltinType::kUndefined},
    {"__mGdf_result_f16", BuiltinType::kUndefined},
    {"__modf_resulFF_f32", BuiltinType::kUndefined},
    {"__modf_eult_E3", BuiltinType::kUndefined},
    {"__odf_resurrt_f32", BuiltinType::kUndefined},
    {"__modf_reslt_vec_abstract", BuiltinType::kUndefined},
    {"__modfJJresuDt_Xc2_abstract", BuiltinType::kUndefined},
    {"_modf_reslt_vec28abstrct", BuiltinType::kUndefined},
    {"__odf_reult_vkc211f1", BuiltinType::kUndefined},
    {"__mdf_result_vec2_f16", BuiltinType::kUndefined},
    {"__modf_resuJt_vec2_f6", BuiltinType::kUndefined},
    {"__modf_result_vec2cf32", BuiltinType::kUndefined},
    {"__modf_result_vec2_fO2", BuiltinType::kUndefined},
    {"KK_movvf_result_vec2_ftt__", BuiltinType::kUndefined},
    {"xx_modf_r8sult_vec3_abtr5ct", BuiltinType::kUndefined},
    {"__modf_resuFt_vec3_aqt__act", BuiltinType::kUndefined},
    {"__modf_result_vec3_aqqstrac", BuiltinType::kUndefined},
    {"__odf_33esult_vec3_f1O6", BuiltinType::kUndefined},
    {"_ttm6df_resQQlt_ooec9_f16", BuiltinType::kUndefined},
    {"_modf_resu66t_vec3_f16", BuiltinType::kUndefined},
    {"__mdf_resultOvxc3_f36zz", BuiltinType::kUndefined},
    {"__modf_resuyyt_vec3_f32", BuiltinType::kUndefined},
    {"__mod_resul_vecZHHf32", BuiltinType::kUndefined},
    {"__modf_reqult_44ec4WWbstract", BuiltinType::kUndefined},
    {"__mof_result_vec4_abstrOOct", BuiltinType::kUndefined},
    {"__modYooresult_vh4_bstract", BuiltinType::kUndefined},
    {"__modf_relt_ve4_f16", BuiltinType::kUndefined},
    {"__modf_result_ve4Ff16", BuiltinType::kUndefined},
    {"__modf_result_wec4_f1", BuiltinType::kUndefined},
    {"__Kdff_rGsult_vec4_f2", BuiltinType::kUndefined},
    {"__modf_reKKulq_vec4_f32", BuiltinType::kUndefined},
    {"__modf_resummt3vec4_f3F", BuiltinType::kUndefined},
    {"__packed_ec3", BuiltinType::kUndefined},
    {"__packed_ecq", BuiltinType::kUndefined},
    {"_backed_bbec3", BuiltinType::kUndefined},
    {"iira", BuiltinType::kUndefined},
    {"aqOOy", BuiltinType::kUndefined},
    {"arvvTTy", BuiltinType::kUndefined},
    {"atomFFc", BuiltinType::kUndefined},
    {"aoQ00P", BuiltinType::kUndefined},
    {"atPmic", BuiltinType::kUndefined},
    {"bos77", BuiltinType::kUndefined},
    {"CoRbbl", BuiltinType::kUndefined},
    {"booXX", BuiltinType::kUndefined},
    {"qOOO6", BuiltinType::kUndefined},
    {"fs", BuiltinType::kUndefined},
    {"f1X", BuiltinType::kUndefined},
    {"f3", BuiltinType::kUndefined},
    {"q", BuiltinType::kUndefined},
    {"f322", BuiltinType::kUndefined},
    {"0yz2", BuiltinType::kUndefined},
    {"iVP", BuiltinType::kUndefined},
    {"Cnn", BuiltinType::kUndefined},
    {"nput_attacAAmeHHt", BuiltinType::kUndefined},
    {"nput_attachment", BuiltinType::kUndefined},
    {"input_attKKfmen", BuiltinType::kUndefined},
    {"Paggx", BuiltinType::kUndefined},
    {"mat2x", BuiltinType::kUndefined},
    {"maN2c42", BuiltinType::kUndefined},
    {"ma7ppl2f", BuiltinType::kUndefined},
    {"mNNt2xg", BuiltinType::kUndefined},
    {"uub2XX2f", BuiltinType::kUndefined},
    {"matx2h", BuiltinType::kUndefined},
    {"Qt882h", BuiltinType::kUndefined},
    {"mt9q2h", BuiltinType::kUndefined},
    {"mat2113", BuiltinType::kUndefined},
    {"Ft2xi22", BuiltinType::kUndefined},
    {"m7t2x3", BuiltinType::kUndefined},
    {"m2t2xNf", BuiltinType::kUndefined},
    {"mVVt2x3f", BuiltinType::kUndefined},
    {"FaWW2w11f", BuiltinType::kUndefined},
    {"mawwx3h", BuiltinType::kUndefined},
    {"Dat2x3h", BuiltinType::kUndefined},
    {"mt2x3K", BuiltinType::kUndefined},
    {"11at2xPP", BuiltinType::kUndefined},
    {"mat2x", BuiltinType::kUndefined},
    {"mat2xYY", BuiltinType::kUndefined},
    {"mttHH4kk", BuiltinType::kUndefined},
    {"mat2rr4f", BuiltinType::kUndefined},
    {"WWas2x4f", BuiltinType::kUndefined},
    {"Yt2x4h", BuiltinType::kUndefined},
    {"mt2qfh", BuiltinType::kUndefined},
    {"mav222xuh", BuiltinType::kUndefined},
    {"mt32", BuiltinType::kUndefined},
    {"maY32", BuiltinType::kUndefined},
    {"YYa7y3E2", BuiltinType::kUndefined},
    {"da3xMof", BuiltinType::kUndefined},
    {"matMMx2", BuiltinType::kUndefined},
    {"mat3x55f", BuiltinType::kUndefined},
    {"maN32", BuiltinType::kUndefined},
    {"ma3Ox33", BuiltinType::kUndefined},
    {"m3t3x2h", BuiltinType::kUndefined},
    {"mt3I3", BuiltinType::kUndefined},
    {"mnnt3xr", BuiltinType::kUndefined},
    {"mXX", BuiltinType::kUndefined},
    {"LatIx3f", BuiltinType::kUndefined},
    {"at3ff", BuiltinType::kUndefined},
    {"mYtURD3", BuiltinType::kUndefined},
    {"mah3x3h", BuiltinType::kUndefined},
    {"uuIqt3x", BuiltinType::kUndefined},
    {"maH3x3h", BuiltinType::kUndefined},
    {"at3Qvv", BuiltinType::kUndefined},
    {"66ate", BuiltinType::kUndefined},
    {"mat7x", BuiltinType::kUndefined},
    {"m55t3x0DD", BuiltinType::kUndefined},
    {"maH3x4II", BuiltinType::kUndefined},
    {"at3x4", BuiltinType::kUndefined},
    {"rat3x499", BuiltinType::kUndefined},
    {"mGtt31W4h", BuiltinType::kUndefined},
    {"yatx4", BuiltinType::kUndefined},
    {"mt4x2", BuiltinType::kUndefined},
    {"maBBI4x2", BuiltinType::kUndefined},
    {"mat8TTx2", BuiltinType::kUndefined},
    {"ddUUnntYYx2f", BuiltinType::kUndefined},
    {"m5CCxxdZ", BuiltinType::kUndefined},
    {"matkkq2f", BuiltinType::kUndefined},
    {"005itpxh", BuiltinType::kUndefined},
    {"maIInnx2h", BuiltinType::kUndefined},
    {"Ka4Wcc", BuiltinType::kUndefined},
    {"mtKK", BuiltinType::kUndefined},
    {"ma664x3", BuiltinType::kUndefined},
    {"mKKtPx", BuiltinType::kUndefined},
    {"xxatx3f", BuiltinType::kUndefined},
    {"qat4x3f", BuiltinType::kUndefined},
    {"MMayySrxf", BuiltinType::kUndefined},
    {"mat3h", BuiltinType::kUndefined},
    {"tx3h", BuiltinType::kUndefined},
    {"ma5F4x3h", BuiltinType::kUndefined},
    {"rraz44x4", BuiltinType::kUndefined},
    {"aWWx", BuiltinType::kUndefined},
    {"ZZJJtCxX", BuiltinType::kUndefined},
    {"maPPx4f", BuiltinType::kUndefined},
    {"mat4c4f", BuiltinType::kUndefined},
    {"matPPll6f", BuiltinType::kUndefined},
    {"mat994yy", BuiltinType::kUndefined},
    {"mat4JKKh", BuiltinType::kUndefined},
    {"mat4_h", BuiltinType::kUndefined},
    {"K", BuiltinType::kUndefined},
    {"kVz", BuiltinType::kUndefined},
    {"KtS", BuiltinType::kUndefined},
    {"ampler", BuiltinType::kUndefined},
    {"aVVpler", BuiltinType::kUndefined},
    {"AAamIlUr", BuiltinType::kUndefined},
    {"jamper_compaRson", BuiltinType::kUndefined},
    {"amplr44compYYriso", BuiltinType::kUndefined},
    {"samper_comparison", BuiltinType::kUndefined},
    {"texxxur_1d", BuiltinType::kUndefined},
    {"tJxucce_1d", BuiltinType::kUndefined},
    {"texure_JJd", BuiltinType::kUndefined},
    {"lextuUe_2fDC", BuiltinType::kUndefined},
    {"textgre_2d", BuiltinType::kUndefined},
    {"CCxtue_2", BuiltinType::kUndefined},
    {"txture_2d_array", BuiltinType::kUndefined},
    {"textu__e_2d_arraI", BuiltinType::kUndefined},
    {"texurPtt_2dNrray", BuiltinType::kUndefined},
    {"tddx3ure_3d", BuiltinType::kUndefined},
    {"teyytur_Kd", BuiltinType::kUndefined},
    {"tetuuud", BuiltinType::kUndefined},
    {"tex0unne_cu3e", BuiltinType::kUndefined},
    {"uuexnure_cuvCK", BuiltinType::kUndefined},
    {"tXllure_cube", BuiltinType::kUndefined},
    {"texture_cppbo_array", BuiltinType::kUndefined},
    {"teture_wwube_array", BuiltinType::kUndefined},
    {"texturgm_cuube_aay", BuiltinType::kUndefined},
    {"texmmre_deaath_", BuiltinType::kUndefined},
    {"textRRcceTdeptZ_2d", BuiltinType::kUndefined},
    {"te88tureOdTpth_2d", BuiltinType::kUndefined},
    {"textume_00epth_2d_array", BuiltinType::kUndefined},
    {"texturm_depth_BBd_array", BuiltinType::kUndefined},
    {"texppur_depth_M_array", BuiltinType::kUndefined},
    {"textre_deptOO_cube", BuiltinType::kUndefined},
    {"texture_deptG_GGbe", BuiltinType::kUndefined},
    {"tHHx11ure_depth_cube", BuiltinType::kUndefined},
    {"texeere_depth_c6bFF_array", BuiltinType::kUndefined},
    {"texure_depth_cub_array", BuiltinType::kUndefined},
    {"tKxtiire_depth_cule_array", BuiltinType::kUndefined},
    {"texture_depth_mulisampled_2d", BuiltinType::kUndefined},
    {"texture99vdpth_multisIImpled_2d", BuiltinType::kUndefined},
    {"texture_depth_multisampled_2", BuiltinType::kUndefined},
    {"texture_hxternal", BuiltinType::kUndefined},
    {"textullPP_extzzrna", BuiltinType::kUndefined},
    {"texure_teral", BuiltinType::kUndefined},
    {"texture_mufftiqqamled_2d", BuiltinType::kUndefined},
    {"tddtuJJe_multisampled_2d", BuiltinType::kUndefined},
    {"texuXXe_multisampldzz2d", BuiltinType::kUndefined},
    {"texturestorag2_1d", BuiltinType::kUndefined},
    {"yyNxture_storage_1d", BuiltinType::kUndefined},
    {"etue_storage_1OO", BuiltinType::kUndefined},
    {"reuEure_storZge_2P", BuiltinType::kUndefined},
    {"teexture_sl2ddrage_d", BuiltinType::kUndefined},
    {"tVVxture_9tagm_2d", BuiltinType::kUndefined},
    {"tIIture_storage_2d_arr1y", BuiltinType::kUndefined},
    {"texture_storagb_2d_array", BuiltinType::kUndefined},
    {"texture_stzrage_2dai7a", BuiltinType::kUndefined},
    {"texoure_storagii_3d", BuiltinType::kUndefined},
    {"exture_ntor5ge3d", BuiltinType::kUndefined},
    {"exture_storiSe_3d", BuiltinType::kUndefined},
    {"22", BuiltinType::kUndefined},
    {"uGC", BuiltinType::kUndefined},
    {"f832", BuiltinType::kUndefined},
    {"e2", BuiltinType::kUndefined},
    {"SJJec2", BuiltinType::kUndefined},
    {"9c", BuiltinType::kUndefined},
    {"vbbJJ2TT", BuiltinType::kUndefined},
    {"e66f", BuiltinType::kUndefined},
    {"u662f", BuiltinType::kUndefined},
    {"vW2h", BuiltinType::kUndefined},
    {"v2h", BuiltinType::kUndefined},
    {"vech", BuiltinType::kUndefined},
    {"rec2i", BuiltinType::kUndefined},
    {"2ec2B", BuiltinType::kUndefined},
    {"vcBBi", BuiltinType::kUndefined},
    {"vRc2u", BuiltinType::kUndefined},
    {"v2LL0", BuiltinType::kUndefined},
    {"vKOOu", BuiltinType::kUndefined},
    {"gwc3", BuiltinType::kUndefined},
    {"hpLc", BuiltinType::kUndefined},
    {"Eiic", BuiltinType::kUndefined},
    {"ec3f", BuiltinType::kUndefined},
    {"UU883", BuiltinType::kUndefined},
    {"rrecvvf", BuiltinType::kUndefined},
    {"ecmm", BuiltinType::kUndefined},
    {"vec4j", BuiltinType::kUndefined},
    {"vec3X", BuiltinType::kUndefined},
    {"vec38", BuiltinType::kUndefined},
    {"vecvEE", BuiltinType::kUndefined},
    {"z99ci", BuiltinType::kUndefined},
    {"GGeJJA3u", BuiltinType::kUndefined},
    {"vess3u", BuiltinType::kUndefined},
    {"vPcKu", BuiltinType::kUndefined},
    {"vtc4", BuiltinType::kUndefined},
    {"e4", BuiltinType::kUndefined},
    {"veMM4", BuiltinType::kUndefined},
    {"vJJc40", BuiltinType::kUndefined},
    {"8c", BuiltinType::kUndefined},
    {"vecggKh", BuiltinType::kUndefined},
    {"vecfh", BuiltinType::kUndefined},
    {"vec47Q", BuiltinType::kUndefined},
    {"veY4h", BuiltinType::kUndefined},
    {"keSi", BuiltinType::kUndefined},
    {"n422", BuiltinType::kUndefined},
    {"vFFi", BuiltinType::kUndefined},
    {"GGIec4PP", BuiltinType::kUndefined},
    {"aeEE4", BuiltinType::kUndefined},
    {"ddBee4u", BuiltinType::kUndefined},
};

using BuiltinTypeParseTest = testing::TestWithParam<Case>;

TEST_P(BuiltinTypeParseTest, Parse) {
    const char* string = GetParam().string;
    BuiltinType expect = GetParam().value;
    EXPECT_EQ(expect, ParseBuiltinType(string));
}

INSTANTIATE_TEST_SUITE_P(ValidCases, BuiltinTypeParseTest, testing::ValuesIn(kValidCases));
INSTANTIATE_TEST_SUITE_P(InvalidCases, BuiltinTypeParseTest, testing::ValuesIn(kInvalidCases));

using BuiltinTypePrintTest = testing::TestWithParam<Case>;

TEST_P(BuiltinTypePrintTest, Print) {
    BuiltinType value = GetParam().value;
    const char* expect = GetParam().string;
    EXPECT_EQ(expect, ToString(value));
}

INSTANTIATE_TEST_SUITE_P(ValidCases, BuiltinTypePrintTest, testing::ValuesIn(kValidCases));

}  // namespace parse_print_tests

}  // namespace
}  // namespace tint::core
